package org.example.extension.beanPostProcessor;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.stereotype.Component;

@Component
public class CustomMergedBeanDefinitionPostProcessor implements MergedBeanDefinitionPostProcessor {

    @Override
    public void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class<?> beanType, String beanName) throws BeansException {
        // 在Bean定义合并后调用
        if(beanName.equals("beanPostProcessorDemo3")){
            System.out.println("CustomMergedBeanDefinitionPostProcessor.postProcessMergedBeanDefinition()");
        }
    }
}
